package com.yuanchu.store.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * @version: 1.0
 * @Author: adan
 * @description:
 * @date: 2024-03-03 14:46
 */
@Data
public class StoreSettingParamsDto implements Serializable {
    private String key;
    private SettingForm form;

    @Data
    public static class SettingForm implements Serializable {
        @JsonInclude(JsonInclude.Include.NON_NULL)
        private String describe;

        @JsonInclude(JsonInclude.Include.NON_NULL)
        @JsonProperty("is_custom")
        private Integer isCustom;

        @JsonInclude(JsonInclude.Include.NON_NULL)
        @JsonProperty("is_entrance")
        private Integer isEntrance;

        @JsonInclude(JsonInclude.Include.NON_NULL)
        @JsonProperty("is_match_plan")
        private Integer isMatchPlan;

        @JsonInclude(JsonInclude.Include.NON_NULL)
        @JsonProperty("lowest_money")
        private Integer lowestMoney;

        @JsonInclude(JsonInclude.Include.NON_NULL)
        @JsonProperty("points_name")
        private String pointsName;

        @JsonInclude(JsonInclude.Include.NON_NULL)
        @JsonProperty("is_shopping_gift")
        private Integer isShoppingGift;

        @JsonInclude(JsonInclude.Include.NON_NULL)
        @JsonProperty("gift_ratio")
        private String giftRatio;

        @JsonInclude(JsonInclude.Include.NON_NULL)
        @JsonProperty("is_shopping_discount")
        private Integer isShoppingDiscount;

        // 配送参数
        @JsonInclude(JsonInclude.Include.NON_NULL)
        private Discount discount;
        @JsonInclude(JsonInclude.Include.NON_NULL)
        @JsonProperty("is_open")
        private int isOpen;
        @JsonInclude(JsonInclude.Include.NON_NULL)
        private double money;
        @JsonInclude(JsonInclude.Include.NON_NULL)
        private ExcludedRegions excludedRegions;
        @JsonInclude(JsonInclude.Include.NON_NULL)
        private List<Integer> excludedGoodsIds;

        // 短信参数
        @JsonInclude(JsonInclude.Include.NON_NULL)
                @JsonProperty("default")
        private String defaultValue;
        @JsonInclude(JsonInclude.Include.NON_NULL)
        private EngineForm engine;
        @JsonInclude(JsonInclude.Include.NON_NULL)
        private SceneForm scene;

    }

    @Data
    public static class Discount implements Serializable {
        @JsonProperty("discount_ratio")
        private double discountRatio;
        @JsonProperty("full_order_price")
        private Integer fullOrderPrice;
        @JsonProperty("max_money_ratio")
        private String maxMoneyRatio;
    }

    @Data
    public static class ExcludedRegions implements Serializable {
        private List<Integer> cityIds;
        private List<SelectedText> selectedText;

    }

    @Data
    public static class SelectedText implements Serializable {
        private String name;
        private List<Map<String, Object>> citys;
    }

    private static class SceneForm {
    }

    private static class EngineForm {
    }
}
